<?php
/**
 * Created by PhpStorm.
 * User: 38339
 * Date: 2021-05-26
 * Time: 14:58
 */

namespace app\common\business\sys;
use app\common\model\sys\CommonSysOtherConfig as Model;
use app\common\model\auth\CommonAdminActionLog;


class CommonSysOtherConfig
{

    /**
     * 【方法注释】获取单条数据
     * @return array|null|\think\Model 返回单个对象
     */
    public static function getOne(){
        return Model::getOne();
    }

    /**
     * 【方法注释】修改数据
     * @param $receiveData 数据数组
     * @return bool 返回是否成功
     */
   public static function edit($receiveData){
       $data = [
           'service_mobile' => $receiveData['service_mobile'],
           'present_percent' => $receiveData['present_percent'],
           'code_minute' => $receiveData['code_minute'],
           'start_ip_status' => $receiveData['start_ip_status']
       ];
       Model::where(['id'=>1])->update($data);
       return true;
   }

    /**
     * 【方法注释】新增数据
     * @param $receiveData 数据数组
     * @return bool 返回是否成功
     */
    public static function insert($receiveData){
        $data = [
            'service_mobile' => $receiveData['service_mobile'],
            'present_percent' => $receiveData['present_percent'],
            'code_minute' => $receiveData['code_minute'],
            'start_ip_status' => $receiveData['start_ip_status']
        ];
        Model::insert($data);
        return true;
    }


}